The invention generally pertains to computer systems, and more specifically, to the disablement of a write filter that is stored on a write-protected partition of a computer system.
Computer systems generally store data in memory and/or mass storage. Memory may comprise, for example, main memory and cache memory. Mass storage may comprise, for example, a number of storage drives such as hard drives and/or removable media drives.
Memory and mass storage components may be classified, in one respect, as either persistent or non-persistent. A persistent component stores data between boots of a computer system, whereas a non-persistent component does not (i.e., data stored in a non-persistent component is flushed between boots). In today""s computer systems, memory is largely comprised of non-persistent components, and mass storage is largely comprised of persistent components.
Regardless of whether a component is persistent or non-persistent, the data stored therein is subject to corruption due to power surges, hard power downs, viruses, and so on. Although corrupted data may be cleared from non-persistent components by rebooting, it is much more difficult to remove corrupted data from persistent componentsxe2x80x94especially when the persistent component is the hard drive which stores a computer system""s operating system. Corruption of operating system files can lead to intermittent failures of a computer system, or even worse, prevent the computer system from booting.
To prevent the corruption of data stored in a persistent component, it is sometimes desirable to write-protect the component. If data cannot be written to the component, it is less likely that the data already stored thereon will become corrupted. For example, Microsoft(copyright) Windows(copyright) NT Embedded provides a write filter which, when enabled, intercepts all writes to designated partitions of mass storage and caches them to main memory. The components that control the NT Embedded write filter are stored as files in a predetermined directory of a computer system""s system partition, and are enabled via a write filter status entry of a system registry stored on the same system partition and executed at system boot. Thus, when the designated partitions are merely data partitions, the write filter may be enabled or disabled at will. However, when the designated partitions include the system partition, it is no longer possible to disable the write filter, since doing so would require a persistent write to the system partition, and writes to the system partition are no longer possible. In computer systems wherein it is desired to write-protect data most of the time, but wherein periodic updates to the system partition are occasionally required, this can be problematic. An update to the system partition may be required, for example, to update components of the operating system, to update application components, to change an IP (internet protocol) address associated with the computer system, etc.
In one preferred embodiment of the invention, a computer system comprises at least primary and secondary partitions, a primary write filter for write-protecting the primary partition, and a state machine. The state machine has at least three states. In the first state, 1) the computer system boots to the primary partition, 2) the primary write filter is enabled, and 3) the state machine advances to a second state in response to a need to write persistent data to the primary partition. In the second state, 1) the computer system boots to the secondary partition, and 2) during the second state, the primary write filter is disabled before the state machine advances to a third state. In the third state, 1) the computer system boots to the primary partition, 2) the primary write filter is initially disabled while persistent data is written to the primary partition, and 3) after persistent data is written to the primary partition, the primary write filter is re-enabled and the state machine advances to the first state.
In another preferred embodiment of the invention, a computer system comprises at least primary and secondary partitions, a primary write filter for write-protecting the primary partition, and a state machine. The state machine, in response to a need to write persistent data to the primary partition, boots to the secondary partition, disables the primary write filter, boots to the primary partition, writes persistent data to the primary partition, re-enables the primary write filter, and then reboots to the primary partition.
In yet another preferred embodiment of the invention, a method for writing persistent data to a normally write-protected primary partition of a computer system comprises installing an operating system on the primary partition of the computer system, and installing an operating system on a secondary partition of the computer system. A write filter stored on the primary partition is then enabled for the purpose of write-protecting the primary partition. Upon a need to write persistent data to the primary partition, the computer system is booted to the secondary partition, the primary write filter is disabled, the computer system is booted to the primary partition, persistent data is written to the primary partition, the primary write filter is re-enabled, and then the computer system is rebooted to the primary partition.
In one more preferred embodiment of the invention, a computer system comprises at least primary and secondary partitions, a primary write filter for write-protecting the primary partition, and a state machine having at least two states. In the first state, 1) the computer system boots to the primary partition, 2) the primary write filter is enabled, and 3) the state machine advances to a second state in response to a need to write persistent data to the primary partition. In the second state, 1) the computer system boots to the secondary partition, and 2) during the second state, persistent data is written to the primary partition before the state machine advances to the first state.
The advantages of these and other embodiments of the invention will be further explained in, or will become apparent from, the accompanying description, drawings and claims.